﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Telerik.WinControls.UI;

namespace QuanLyNhaSach
{
    public partial class frmDanhMucHangHoa : Form
    {
        public frmDanhMucHangHoa()
        {
            InitializeComponent();

        }

        private void bt_them_ToggleStateChanged(object sender, Telerik.WinControls.UI.StateChangedEventArgs args)
        {
            radGridView1.AllowAddNewRow = true;
        }

        private void frmDanhMucHangHoa_Load(object sender, EventArgs e)
        {
            this.radGridView1.TableElement.BeginUpdate();
            this.radGridView1.MasterTemplate.EnableFiltering = true;
            this.radGridView1.MasterTemplate.AutoExpandGroups = true;
            this.radGridView1.MasterTemplate.AllowAddNewRow = false;
            this.AddSummaries();
            this.radGridView1.TableElement.EndUpdate();
            this.radGridView1.Columns[0].Width = 300;
        }
        private void AddSummaries() 
        {
            GridViewSummaryRowItem item1 = new GridViewSummaryRowItem();
            item1.Add(new GridViewSummaryItem("column1", "Tổng bản ghi: {0}", GridAggregateFunction.Count)); 
            this.radGridView1.MasterTemplate.SummaryRowsTop.Add(item1); 
        }
    }
}
